home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 8592 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: serra.unipi.it!vanni
  2. From: vanni@fox.ino.it (Vanni Guarneri)
  3. Newsgroups: comp.lang.c
  4. Subject: Function with values from a table
  5. Date: 5 Mar 1996 09:34:48 GMT
  6. Organization: Istituto Nazionale di Ottica-Florence-ITALY
  7. Message-ID: <4hh1ro$19i8@serra.unipi.it>
  8. NNTP-Posting-Host: a730.ino.it
  9. X-Newsreader: TIN [version 1.2 PL2]
  10.  
  11. Hi,
  12.  
  13. I have to use a routine of "numerical recipies" in which an external function 
  14.  g is required.
  15.  
  16. My problems are:
  17.  
  18. the values of g are known by means of a table (i.e. it not exist an analytical
  19. form of it) being it defined by experimental data.
  20.  
  21. The routine I have to use is so defined:
  22.  
  23. void fred2(... ... ... float (*g)(float))
  24.  
  25. So I have to use a pointer to a function whose values are taken by a table and it
  26. has to be called by means of a pointer.
  27.  
  28. What could I do ? (I cannot change the declaration of the routine)
  29. BTW I have a file with the values of the function sampled in couples
  30. X, Y).
  31.  
  32. Any help will be very appreciated
  33.  
  34.  
  35.  Best regards
  36.  
  37.   Vanni Guarnieri
  38.  
  39. *******************************************
  40. * Vanni Guarnieri                         *
  41. * Istituto Nazionale di Ottica            *
  42. * Largo  Enrico Fermi, 6                  *
  43. * 50125 Firenze                           *
  44. * ITALIA                                  *
  45. * Phone: (39)55-23.081                    *
  46. * Fax:   (39)55-233.77.55                 *
  47. *******************************************
  48.